<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>自定义动画</title>
		<script src="js/jquery-3.3.1.min.js" type="text/javascript" charset="utf-8"></script>
		<style type="text/css">
			.test{
				background: #98bf21;
				height: 100px;
				width: 100px;
				position: absolute;
			}
		</style>
	</head>
	<body>
		<div class="test">
			
		</div>
	</body>
</html>
<script type="text/javascript">
	$(()=>{
		$(".test").click(()=>{
			$(".test").animate({
				left:'+=200px',
				top:'+=200px',
				width:'200px',
				height:'200px'
			},2000,()=>{
				$(".test").animate({
					left:'0px',
					top:'0px',
					width:'100px',
					height:'100px'
				},2000)
			})
		})
	})
</script>